package littlewhisker.components.ui {
	import littlewhisker.components.AbstractComponent;



	import flash.display.Sprite;
	
	/**
	 * @author Philip
	 */
	public class AbstractUIComponent extends AbstractComponent implements IUIComponent {
		
		private var _enabled:Boolean;
	
		public function get enabled() : Boolean {
			return _enabled;
		}
		
		public function set enabled(enabled : Boolean) : void {
			if(enabled != _enabled) {	
				_enabled = enabled;
				_enabled ? enable() : disable();	
			}
		}
		
		public function destroy():void{
			enabled = false;
		}
		
		override public function set asset(asset : Sprite) : void {
			super.asset = asset;
			enable();
		}
		
		protected function enable():void{
		}
		
		protected function disable():void{
		}
		
	}
}
